﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using CCF20Model;

namespace CCF20Module
{
    /// <summary>
    /// Interaction logic for CompanyProfile.xaml
    /// </summary>
    public partial class UpdateCompanyProfile
    {
        public UpdateCompanyProfile()
        {
            InitializeComponent();
            this.DataContext = ProfileModel.GetCompanyProfile();
        }
        
        private void SaveProfile_Click(object sender, RoutedEventArgs e)
        {
            Button btn = (Button)sender;
            if (btn.Content.ToString() == "保存")
            {
                ProfileModel.Update((string)Application.Current.Properties["CurrentUser"]);
                //CCFZIC zic = new CCFZIC();
                //string ret = zic.UpdateCompanyProfile(this.txtIDSUserName.TextBoxValue,
                //                         this.txtCustomerName.TextBoxValue,
                //                         this.txtOwnerName.TextBoxValue,
                //                         this.txtFirstMobile.TextBoxValue,
                //                         this.txtContactPhone.TextBoxValue,
                //                         this.txtFax.TextBoxValue,
                //                         string.Empty,//this.txtWebSite.TextBoxValue,
                //                         this.txtAddress.TextBoxValue);

                Utility.ShowMessageBox("保存成功");
                
            }
            
            
            
        }

        private void CCFBase_Loaded(object sender, RoutedEventArgs e)
        {
            ApplyResourceToButton();
            ApplyResourceToCLRObjectBoundTextBox();
            ApplyResourceToLable();
        }
    }
}
